s = input()
s1 = ''
s2 = ''
k = 0
for i in range(len(s)):
    if s[i] in '([{<>}])':
        s2 = s2 + s[i]
for i in range(len(s2)):
    if s2[i] in '([{<':
        s1 = s1 + s2[i]
    elif len(s1) > 0 and s[i] == ')' and s1[-1] == '(':
        s1 = s1[:-1]
    elif len(s1) > 0 and s[i] == ']' and s1[-1] == '[':
        s1 = s1[:-1]
    elif len(s1) > 0 and s[i] == '}' and s1[-1] == '{':
        s1 = s1[:-1]
    elif len(s1) > 0 and s[i] == '>' and s1[-1] == '<':
        s1 = s1[:-1]
    else:
        k += 1
        break 
    print(s1)
if s1 == '' and k == 0:
    print("+")
else:
    print("-")
